package models;

import models.crudsiena.SienaSupport;
import play.data.validation.MaxSize;
import play.modules.siena.EnhancedModel;
import siena.*;

/**
 * Created by IntelliJ IDEA.
 * User: Cyril
 * Date: 04.08.11
 * Time: 23:14
 * To change this template use File | Settings | File Templates.
 */
@Table("pages")
public class Page extends SienaSupport {

    @Id(Generator.AUTO_INCREMENT)
    public Long id;

    @Column("url")
    @Max(150)
    public String url;

    @Column("title")
    @Max(150)
    public String title;

    @Column("meta")
    public String metadata;

    @Column("content")
    @Text
    @Max(10000)
    public String content;

    @Override
    public String toString() {
        return "@" + title;
    }

    public static Query<Page> all() {
        return Model.all(Page.class);
    }
}
